package com.whz.method;

import lombok.extern.slf4j.Slf4j;

import java.util.Date;

/**
 * @Author: sinosoft
 * @Description:
 * @Date: Create in 9:55 2021/5/19
 * @Modified By:
 */
@Slf4j
public class MainTest {
    public static void main(String[] args) {
        Period period = new Period(new Date(2021,1,2), new Date(2021,1,3));
        log.info("period: {}", period.hashCode());
        log.info("period: {}", period);
        period.start().setDate(4);
        log.info("period: {}", period.hashCode());
        log.info("period: {}", period);
        log.info("带有保护拷贝的类");

        Period1 period1 = new Period1(new Date(2021,1,2), new Date(2021,1,3));
        log.info("period: {}", period1.hashCode());
        log.info("period: {}", period1);
        period1.start().setDate(4);
        log.info("period: {}", period1);
    }
}
